package 天气数据;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

public class Group extends WritableComparator {
    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        Data d1 = (Data) a;
        Data d2 = (Data) b;
        String date1 = d1.getYear() + d1.getMonth() + d1.getDay();
        String date2 = d2.getYear() + d2.getMonth() + d2.getDay();
        return date1.compareTo(date2);
    }
    protected Group(){
        super(Data.class,true);
    }
}
